package com.java.control.search;

/**
 * 产品
 * @author wqf
 * @version  Nov 24, 2011 11:55:45 AM
 */
public class ProductSearchCond extends SearchCond{
	
	private String productName;
	private String productNo;

	public String getProductNo() {
		return productNo;
	}


	public void setProductNo(String productNo) {
		this.productNo = productNo;
	}


	public ConditionPart getCondition(){
		ConditionPart cp=new ConditionPart();
		StringBuffer searchStr=new StringBuffer(" 1=1");
		
		if(null!=productName){
			searchStr.append(" and name like ?");
			cp.getParams().add("%"+productName+"%");
		}
		if(null!=productNo){
			searchStr.append(" and productNo like ?");
			cp.getParams().add("%"+productNo+"%");
		}
		cp.setExpression(searchStr.toString());
		return cp;
	}


	public String getProductName() {
		return productName;
	}


	public void setProductName(String productName) {
		this.productName = productName;
	}

}
